<?php
include_once("./common.inc.php");
$smarty = new Tpl();

$cid = intval(get_param('cid'));
$jobsModel = load_model("jobs");
$jobs = $jobsModel->get_jobs();
if( $jobs && isset($jobs[0]) ){
	$smarty->assign('list', $jobs);

	$cid = empty($cid) ? $jobs[0]['id'] : $cid;
	$smarty->assign('cid', $cid);

	foreach( $jobs as $v ){
		if($v['id']==$cid){
			$curtJobs = $v;
		}
	}
	$smarty->assign("curtJobs", $curtJobs);
}else{
	$smarty->assign('nodata','1');
}
$smarty->display('jobs.html');
